package com.sskj.run.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.run.bean.FaqBean;
import com.sskj.run.http.HttpConfig;
import com.sskj.run.ui.fragment.FAQFragment;

import java.util.List;

/**
 * Created by QinKang on 2018/12/29.
 */

public class FAQFragmentPresenter extends BasePresenter<FAQFragment> {


    /**
     * 公共数据
     */
    public void getFAQ() {
        httpService.getFAQ()
                .tag(this)
                .execute(new JsonCallBack<HttpData<List<FaqBean>>>() {
                    @Override
                    public void onSuccess(Response<HttpData<List<FaqBean>>> response) {
                        HttpData<List<FaqBean>> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updataUI( httpData.getData());
                        }
                    }
                });
    }


}
